﻿<UserControl x:Class="SkladLib.ListViewSklad.userListViewSklad"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
             mc:Ignorable="d" 
             d:DesignHeight="300" d:DesignWidth="300" Loaded="userListViewSklad_Loaded_1">
    <UserControl.Resources>
        
        <DataTemplate x:Key="imageNaSklade">
            <Image Width="20" Height="20" x:Name="TheImage" />
            <DataTemplate.Triggers>
                <DataTrigger Binding="{Binding Path=naSklade}" Value="true">
                    <Setter TargetName="TheImage" Property="Source" Value="../Graphic/Images/yes20x20.png" />
                </DataTrigger>
                <DataTrigger Binding="{Binding Path=naSklade}" Value="false">
                    <Setter TargetName="TheImage" Property="Source" Value="../Graphic/Images/no20x20.png" />
                </DataTrigger>
            </DataTemplate.Triggers>
        </DataTemplate>
    </UserControl.Resources>
    <Grid>
        <ListView Loaded="lvSklad_Loaded_1" Focusable="False" Name="lvSklad" ItemsSource="{Binding}" Grid.RowSpan="2" SelectionMode="Single" Grid.Column="1" IsEnabled="False">
            <ListView.ContextMenu >
                <ContextMenu x:Name="conMenuSklad" Focusable="False" Opened="conMenuSklad_Opened_1">
                    <MenuItem Header="Smazat" Name="conMenuSmazat" Focusable="False" Click="ConMenuSmazat_Click_1"/>
                    <MenuItem Header="Do skladu/z skladu" x:Name="conMenuDoSkladu" Focusable="False" Click="ConMenuDoSkladu_Click_1"/>
                </ContextMenu>
            </ListView.ContextMenu>
            <ListView.View>
                <GridView>
                    <GridViewColumn  Width="Auto" Header="KÓD"  
                                    DisplayMemberBinding="{Binding Path=kod}"  />
                    <GridViewColumn Width="Auto" Header="NÁZEV" 
                                    DisplayMemberBinding="{Binding Path=name}"  />
                    <GridViewColumn Width="Auto" Header="CENOVÝ PROFIL" 
                                    DisplayMemberBinding="{Binding Path=CenovyProfilName}"  />
                    <GridViewColumn Width="Auto" Header="NA SKLADĚ" 
                                     CellTemplate="{StaticResource imageNaSklade}"/>
                    <GridViewColumn Width="Auto" Header="REZERVACE" 
                                    DisplayMemberBinding="{Binding Path=rezervaceJmeno}"  />
                    <GridViewColumn Width="Auto" Header="OD" 
                                    DisplayMemberBinding="{Binding Path=rezervaceOd}"  />
                    <GridViewColumn Width="Auto" Header="DO" 
                                    DisplayMemberBinding="{Binding Path=rezervaceDo}"  />
                </GridView>
            </ListView.View>
        </ListView>
    </Grid>
</UserControl>
